//
//  YJWRecommendUserCell.m
//  百思不得骑姐
//
//  Created by YJW on 16/10/19.
//  Copyright © 2016年 yijiang. All rights reserved.
//

#import "YJWRecommendUserCell.h"
#import "YJWUser.h"
#import <UIImageView+WebCache.h>

@interface YJWRecommendUserCell ()

@property (weak, nonatomic) IBOutlet UIImageView *headerImgV;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *fansLabel;

@end

@implementation YJWRecommendUserCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setUser:(YJWUser *)user{
    
    _user = user;
    
    self.nameLabel.text = user.screen_name;
    
    if (user.fans_count < 10000) {
        self.fansLabel.text = [NSString stringWithFormat:@"%zd 人已关注",user.fans_count];
    }else{
        self.fansLabel.text = [NSString stringWithFormat:@"%.1f 万人关注",user.fans_count/10000.0];
    }
    
    [self.headerImgV sd_setImageWithURL:[NSURL URLWithString:user.header] placeholderImage:[UIImage imageNamed:@"defaultUserIcon"]];
}

@end
